<template>
  <el-dialog v-model="open" :title="title" width="500px" append-to-body :close-on-click-modal="false">
    <el-form ref="dialogRef" label-width="100px">
      <el-form-item label="下载模板">
        <el-link type="primary" href="/file/memberTemplate.xlsx" target="_blank">会员模板</el-link>
      </el-form-item>

      <el-form-item label="上传模板" prop="discount">
        <fileUpload ref="upload" name="excel" action="/systemj/member/importUser" @uploadSuccess="uploadSuccess" />
      </el-form-item>
    </el-form>


  </el-dialog>
</template>

<script setup>
import { getCurrentInstance } from '@vue/runtime-core'
import { reactive, watch } from 'vue'
import { toRefs } from '@vueuse/shared'
import { importUser } from '../../../../../api/ven/member'
import { dayjs } from 'element-plus'
const { proxy } = getCurrentInstance()
const props = defineProps({
  props: {
    type: Object,
    default: () => ({
      open: false,
      title: ''
    })
  },
  cardList: {
    type: Array,
    default: () => []
  }
})
const emit = defineEmits(['uploadSuccess'])
const formBase = {
  expireDateType: '1'
}
const { open, title } = toRefs(props.props)

function uploadSuccess(res) {
  console.log(res)
  cancel()
  proxy.$modal.msgSuccess(`${res.data}`)
  emit('uploadSuccess')
  proxy.$refs['upload'].handleClear()
}

function cancel() {
  open.value = false
}

</script>

<style scoped>

</style>
